#define _CRT_SECURE_NO_WARNINGS 1
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'

void solve() {
	string s; cin >> s;
	for (int i = 0; i < s.size(); i++) {
		if (s[i] != 'Y' && s[i] != 'e' && s[i] != 's') {
			cout << "NO" << endl;
			return;
		}
	}
	for (int i = 1; i < s.size(); i++) {
		if ((s[i] == 'Y' && s[i - 1] != 's') || (s[i] == 'e' && s[i - 1] != 'Y') || (s[i] == 's' && s[i - 1] != 'e')) {
			cout << "NO" << endl;
			return;
		}
	}
	cout << "YES" << endl;
}

int main() {
	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	int t; cin >> t;
	while (t--) {
		solve();
	}
	return 0;
}